<%@ include file="/view/template/header.jsp"%>	
	<div id="content">
    	<%@ include file="/view/admin/admin_common.jsp"%>
        	<div class="right-content">
				<div class="box">
					<div class="con-part" >
						<h3>
							<c:if test="${param.message !=null }">
       							<%out.print(request.getParameter("message"));%>
							</c:if>
						</h3>
					</div>
					<div class="con-part"></div>
					<div class="clear"></div>
				<h1><s:text name="menu.system_admin.add_users_to_user_class"/></h1>
				<div class="sub_box">
				<form method="post" id="add_users_to_user_classes_form">
				<div class="con-part"><span>
				<s:label key="label.user.username" cssClass="label_text"></s:label>
				<img name="required" src="<% out.print(baseURL);%>/view/required.jpg" width="15" height="20" alt="required" />
				</span> 
				<input id="username" name="username" class="input-text"/> </div>
						
						<div class="con-part">
							<span>
								<s:label key="label.user_group.name" cssClass="label_text"></s:label>
							<img name="required" src="<% out.print(baseURL);%>/view/required.jpg" width="15" height="20" alt="required" />
							</span>
							<s:select name="userGroup"
								list="#{'1': 'User', '2': 'Administrator','3': 'Patient','4': 'Doctor','5': 'Nurse','6': 'Consultant','7': 'Admitting_Officer','8': 'Pharmacist'}"
								headerKey="" headerValue="---Select User Group---"
								class="select_box">
							</s:select> 
						</div> 	
							
					<div class="con-part"><span>&nbsp;</span> <!-- <input type="submit"  value="Search" class="green"/> -->
						<s:submit key="label.admin.add" cssClass="green" />  </div>
					
					
				</form>
			</div>
			</div>
		</div>
    </div>

	<%@ include file="/view/template/footer.jsp"%>

	<script>
	$(document).ready(function(){

        var x=$("#add_users_to_user_classes_form").validate({
            rules: {
            username: {
                required: true,
                
            },
            userGroup: {
                required: true,
                
            }
            
            },
            
            messages: {
            	username: {
                    required: "Username Required"
                    
                },

                userGroup: {
                    required: "user Group Required",
                    
                },
            }
        });
        //return x.form();
    });
   
   
    jQuery.validator.addMethod("lettersonly", function(value, element) {
        return this.optional(element) || /^[a-z]+$/i.test(value);
      }, "Letters only please");
   
    $.validator.addMethod("custom_number", function(value, element) {
        return this.optional(element) || value === "NA" ||
            value.match(/^[0-9,\+-]+$/);
    }, "Please enter a valid number, or 'NA'");
  </script>